package com.gokzzz.killdemo.service.impl;

import com.gokzzz.killdemo.service.SkuService;
import com.gokzzz.killdemo.util.RedisUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author gokzzz
 * @date 2022-09-10 12:07
 */
@Service
public class SkuServiceImpl implements SkuService {
    @Resource
    private RedisUtil redisUtil;

    @Override
    public Long selectSku() {
        return Long.parseLong(String.valueOf(redisUtil.get("sku")));
    }

    @Override
    public void initSku(Long num) {
        redisUtil.set("sku", num);
    }

}
